package com.danceforyou.salary.service.impl;

import com.danceforyou.common.service.impl.BaseServiceImpl;
import com.danceforyou.salary.dao.SalaryEntryDAO;
import com.danceforyou.salary.model.SalaryEntryDO;
import com.danceforyou.salary.service.SalaryEntryService;
import com.danceforyou.salary.vo.SalaryEntryVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* 类名称：SalaryEntryServiceImpl
* 创建人：danceforyou
* 创建时间：2021年02月08日
* 版本号：1.0v
*/
@Service("salaryEntryService")
public class SalaryEntryServiceImpl extends BaseServiceImpl<Long, SalaryEntryDO, SalaryEntryVO, SalaryEntryDAO> implements SalaryEntryService {
    @Autowired
    private SalaryEntryDAO salaryEntryDAO;

    @Override
    public SalaryEntryDAO getDao() {
        return salaryEntryDAO;
    }

    @Override
    public void saveInfo(SalaryEntryDO salaryEntry) {
        this.insert(salaryEntry);
    }

    @Override
    public void updateInfo(SalaryEntryDO salaryEntry) {
        this.update(salaryEntry);
    }

    @Override
    public int deleteInfoByIds(String ids) {
        String[] idArr = ids.split(",");
        int i = 0;
        for (String id : idArr) {
            i += this.deleteById(id);
        }
        return i;
    }
}
